import Vapor

/// Register your application's routes here.
public func routes(_ router: Router) throws {
    // Basic "It works" example
    router.get { req in
        return "It works!"
    }
    
    // Basic "Hello, world!" example
    router.get("hello") { req in
        return "Hello, world!"
    }
    
    // api
    let apiRouter = router.grouped("api")
    
    // user
    let userRouter = apiRouter.grouped("users")
    try userRouter.register(collection: AccountController())
    // file
    let fileRouter = apiRouter.grouped("file")
    try fileRouter.register(collection: FileUploadController())
    // story
    let storyRouter = apiRouter.grouped("story")
    try storyRouter.register(collection: StoryController())
    // comment
    let commentRouter = apiRouter.grouped("comment")
    try commentRouter.register(collection: CommentController())
}
